n = int(input())
List = []
for i in range(n):
    a, t = list(map(float, input().split()))
    List.append((a, t))
List1 = [0 for i in range(2000000)]
for i in range(n):
    for j in range(1, int(List[i][1] + 1)):
        List1[int(List[i][0] * j)] = int(not List1[int(List[i][0] * j)])
for i in range(1, 2000000):
    if List1[i] == 1:
        print(i)
#先输入的a与t以元组的形式存在列表内，根据题目要求，范围在1到2000000之间，认定开灯为1，不开灯为0，进行几次循环后得出
